#pragma once

#include "VUi.h"
#include "VSingerCoverEffect.h"
#include "VSingerNavigator.h"
#include "VPageWidget.h"

#include <deque>



class CSingerCoverData;
class CSingerAnimationCtrl;
class VPicture;
class VSingerEffect;
class VSingerWall;

class VSingerUi :
    public VUi
{
public:
    VSingerUi();
    ~VSingerUi();

public:
    void push_back(singer_t* singer);
    void clear(void);

public:
    VSingerCoverEffect* getCover(void);
    VSingerWall* getWall(void);
    VSingerNavigator* getNav(void);
    VPageWidget* getPage(void);

    VSingerEffect* currentEffect(void);

public:
    void setupEffect(void);
    void setupTextureDelegate(void);

public:
    static void page_callback(int pg, int it, char dir);
    void click_callback(singer_t* singer);

protected:
    enum
    {
        COVER,
        WALL
    };

public:
    static bool switch_effect(int x, int y, VWidget* btn);
    static void qt_callback(int no, GLuint** texture);
    static void qp_callback(int no, std::string* filename);

public:
    static void clicked(singer_t* singer);

public:
    void initializeTextures(void);
    void autoLoadTexture();
    void loadTexture(singer_t* singer);
    void releaseTexture(singer_t* singer);
    void releaseAllTexture(void);
    void autoSet(void);

protected:
    VSingerCoverEffect* _cover;/* /     */
    VSingerNavigator* _nav;/*    /|     */
    VSingerWall* _wall;/*       /-|     */
    VPageWidget* _pg;/*        /--|     */
    VButton* _swieff;/*       /---|     */
    __int8 _cefct;/*         /----|     */
    int _texture_delegate_range_id;/*   */

protected:
    typedef std::vector<singer_t*> _idarray_t;

    _idarray_t _idarray;
};
